﻿// Write a program that reads two positive integer numbers and prints how many numbers p exist between them such that
// the remainder of the division by 5 is 0 (inclusive). Example: p(17,25) = 2.

using System;

class CountNumbersDivBy5
{
    static void Main()
    {
        Console.Write("Enter first positive integer number : ");
        string numberStr1 = Console.ReadLine();
        int number1;
        if (!int.TryParse(numberStr1, out number1))
        {
            Console.WriteLine("Your first entered number is invalid!");
        }
        
        Console.Write("Enter second positive integer number : ");
        string numberStr2 = Console.ReadLine();
        int number2;
        if (!int.TryParse(numberStr2, out number2))
        {
            Console.WriteLine("Your second entered number is invalid!");
        }

        int count = 0;

        for (int i = number1; i <= number2; i++)
        {
            if (i % 5 == 0)
            {
                count++;
            }
        }
        Console.WriteLine("p ({0}, {1}) = {2}", number1, number2, count);
    }
}
